<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Table extends CI_Controller {


	function index()
	{
		$this->load->library('table');

		$data = array(
             array('Name', 'Color', 'Size'),
             array('Fred', 'Blue', 'Small'),
             array('Mary', 'Red', 'Large'),
             array('John', 'Green', 'Medium') 
             );

		$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

		$this->table->set_template($tmpl); 

		$this->table->set_caption('Colors');

		echo $this->table->generate($data); 

		$this->table->clear();

		$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');

		$new_list = $this->table->make_columns($list, 3);

		echo $this->table->generate($new_list);



	}
}

/* End of file table.php */
/* Location: ./application/controllers/table.php */